package com.unmarshaller.propertiesunmarshaller;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

/**
 * propertyes原型数据处理类
 * @author hongxiao.z
 * @date	2013-10-18
 */
public class PropertyProcess 
{
	private static Collection<Class<?>> coll = new ArrayList<Class<?>>();
	
	private static void loadConfig(List<Class<?>> clazzs)
	{
		coll.addAll(clazzs);
	}
	
	private static void loadConfig(Class<?> clazz)
	{
		coll.add(clazz);
	}
	
	public static void process(List<Class<?>> clazzs)
	{
		loadConfig(clazzs);
		process();
	}
	
	public static void process(Class<?> clazz)
	{
		loadConfig(clazz);
		process();
	}
	
	/**
	 * 解析所有配置文件。
	 * @date	2013-10-21
	 * @create	hongxiao.z
	 */
	public static void process()
	{
		try
		{
			for (Class<?> clazz : coll) 
			{
				PropertyUnmarshaller.unmarshaller(clazz);
			}
		}
		catch(Exception e)
		{
			e.printStackTrace();
		}
		
		coll.clear();
	}
}
